package com.example.demo.controller;

import com.example.demo.model.UserInfo;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;

@Controller
public class UserController3 {
    @Autowired
    @Qualifier("user1")
    private UserInfo userInfo;

    @Autowired
    public UserController3(@Qualifier("user3") UserInfo userInfo) {
        this.userInfo = userInfo;
    }

//    @Autowired
//    @Qualifier("user2")
//    public void setUserInfo(UserInfo userInfo) {
//        this.userInfo = userInfo;
//    }

    public UserInfo getUserInfo() {
        return userInfo;
    }
}
